package com.neusoft.yuejian_6.activity;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

import com.neusoft.yuejian_6.R;
import com.squareup.picasso.Picasso;

public class PrizeInfoActivity extends Activity {

    private ImageView prize_pic;
    private TextView prize_intro;
    private TextView prize_name;
    private TextView prize_amount;
    private int prize_id;
    private ImageView back;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_prize_info);
        initView();
        getPrizeData();
        initEvent();
    }

    public void initEvent(){
        back.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                finish();
            }
        });



    }


    private void getPrizeData() {
        Bundle bundle = this.getIntent().getExtras();
        String prizeintro = bundle.getString("prize_intro");
        String prizename = bundle.getString("prize_name");
        String prizeamount = bundle.getString("prize_amount");
        // int tprice = bundle.getInt("t_price");
        String ppic = "http://10.0.2.2/neu1_yuejian/Public/Admin/photo/"+bundle.getString("prize_pic");
        //String ttime = bundle.getString("t_time");
        //System.out.print("taddress");
        prize_intro.setText(prizeintro);
        prize_name.setText(prizename);
        prize_amount.setText(prizeamount);

        // t_price.setText(tprice+"");
        //System.out.print("train_intro");
        //   t_time.setText(ttime);
        Picasso.with(this).load(ppic).into(prize_pic);
    }


    private void initView() {

        prize_pic = (ImageView) findViewById(R.id.prize_pic);
        prize_intro = (TextView) findViewById(R.id.prize_intro);
        prize_name = (TextView) findViewById(R.id.prize_name);
        prize_amount = (TextView) findViewById(R.id. prize_amount);
        back=(ImageView) findViewById(R.id.back);
    }

    /**
     * ATTENTION: This was auto-generated to implement the App Indexing API.
     * See https://g.co/AppIndexing/AndroidStudio for more information.
     */

}
